﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Super_Wall_Breaker.Sources.Configuration
{
    /// <summary>
    ///  This class defines the game creation configuration in fonction of the options choose in the option menu.
    ///  It's a singleton, to get the configuration use the GetInstance property.
    /// </summary>
    public class GameCreationConfiguration
    {
        private static GameCreationConfiguration gameCreationConfiguration = null;

        private PlayerEntries playerOneConfig = PlayerEntries.Keyboard;
        private PlayerEntries playerTwoConfig = PlayerEntries.Keyboard;
        private PlayerEntries playerThreeConfig = PlayerEntries.AI;
        private PlayerEntries playerFourConfig = PlayerEntries.AI;
        private bool soundMuted = false;
        private bool musicMuted = false;
        private int totalTime = 5; //in minutes

        public int TotalTime
        {
            get { return totalTime; }
            set { totalTime = value; }
        }        

        public PlayerEntries PlayerOneConfig
        {
            get { return playerOneConfig; }
            set { playerOneConfig = value; }
        }

        public PlayerEntries PlayerTwoConfig
        {
            get { return playerTwoConfig; }
            set { playerTwoConfig = value; }
        }

        public PlayerEntries PlayerThreeConfig
        {
            get { return playerThreeConfig; }
            set { playerThreeConfig = value; }
        }

        public PlayerEntries PlayerFourConfig
        {
            get { return playerFourConfig; }
            set { playerFourConfig = value; }
        }

        public bool MusicMuted
        {
            get { return musicMuted; }
            set { musicMuted = value; }
        }

        public bool SoundMuted
        {
            get { return soundMuted; }
            set { soundMuted = value; }
        }        

        private GameCreationConfiguration()
        {        
        }

        /// <summary>
        /// Return the Game Creation Configuration singleton.
        /// </summary>
        /// <returns></returns>
        public static GameCreationConfiguration GetInstance()
        {
            if (gameCreationConfiguration == null)
                gameCreationConfiguration = new GameCreationConfiguration();

            return gameCreationConfiguration;
        }
    }
}
